package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 行政区划转换规则表
 *
 * @author dlb
 * @since 2023-02-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_area")
@Schema(name = "EduArea", title = "行政区划转换规则表", description = "行政区划转换规则表实体类")
public class EduArea extends Model<EduArea> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "areaId", title = "行政区划id")
    @TableId(value = "area_id", type = IdType.ASSIGN_ID)
    private String areaId;

    @Schema(name = "areaCode", title = "行政区划标准编码")
    @TableField(value = "area_code")
    private String areaCode;

    @Schema(name = "localCode", title = "本地自定义编码")
    @TableField(value = "local_code")
    private String localCode;

    @Schema(name = "areaName", title = "组织名称")
    @TableField(value = "area_name")
    private String areaName;

    @Schema(name = "orgType", title = "行政区划类型 ")
    @TableField(value = "org_type")
    private String orgType;

    @Schema(name = "contact", title = "联系人")
    @TableField(value = "contact")
    private String contact;

    @Schema(name = "cellphone", title = "联系人手机")
    @TableField(value = "cellphone")
    private String cellphone;

    @Schema(name = "phone", title = "联系人电话")
    @TableField(value = "phone")
    private String phone;

    @Schema(name = "rate", title = "级别")
    @TableField(value = "rate")
    private Integer rate;

    @Schema(name = "orderNo", title = "排序号")
    @TableField(value = "order_no")
    private Integer orderNo;

    @Schema(name = "address", title = "地址")
    @TableField(value = "address")
    private String address;

    @Schema(name = "longitude", title = "经度")
    @TableField(value = "longitude")
    private BigDecimal longitude;

    @Schema(name = "latitude", title = "纬度")
    @TableField(value = "latitude")
    private BigDecimal latitude;

    @Schema(name = "remarks", title = "描述")
    @TableField(value = "remarks")
    private String remarks;

    @Schema(name = "status", title = "状态")
    @TableField(value = "status")
    private String status;
    @Schema(name = "parentId", title = "上级地址/区域")
    @TableField(value = "parent_id")
    private String parentId;
    @Schema(name = "del", title = "0,未删除,1,已删除")
    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Schema(name = "createName", title = "创建人")
    @TableField(value = "create_name", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", title = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", title = "修改人")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", title = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Override
    public Serializable pkVal() {
        return this.areaId;
    }
}
